import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'

// 导入树状表格插件
import ZkTable from 'vue-table-with-tree-grid'
// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'

// 导入字体图标
import '@/assets/fonts/iconfont.css'
// 导入全局样式
import '@/assets/css/global.css'

// 导入富文本样式
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
// 注册树状表格组件
Vue.component('tree-table', ZkTable)
// 注册富文本编辑器组件
Vue.use(VueQuillEditor)

Vue.config.productionTip = false

// 处理时间的过滤器
Vue.filter('dateFormat', value => {
  const time = new Date(value)
  const year = time.getFullYear()
  const month = ((time.getMonth() + 1) + '').padStart(2, '0')
  const day = (time.getDate() + '').padStart(2, '0')
  const hour = (time.getHours() + '').padStart(2, '0')
  const min = (time.getMinutes() + '').padStart(2, '0')
  const sec = (time.getSeconds() + '').padStart(2, '0')
  return `${year}-${month}-${day} ${hour}:${min}:${sec}`
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
